package com.qd.system.model;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * @author sjk
 */
@Getter
@Setter
@Accessors(chain = true)
@TableName("sys_role")
public class Role extends Model<Role> implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 主键
     */
    @TableId(value = "role_id", type = IdType.ASSIGN_ID)
    private String roleId;
    /**
     * 父级角色ID
     */
    @TableField("role_parent_id")
    private String roleParentId;
    /**
     * 角色编码
     */
    @TableField("role_code")
    private String roleCode;
    /**
     * 角色名称
     */
    @TableField("role_name")
    private String roleName;
    /**
     * 角色序号
     */
    @TableField("role_sort")
    private Integer roleSort;
    /**
     * 角色状态:0正常 1停用
     */
    @TableField("role_status")
    private Integer roleStatus;
    /**
     * 添加时间
     */
    @TableField("add_time")
    private LocalDateTime addTime;
    /**
     * 修改时间
     */
    @TableField("update_time")
    private LocalDateTime updateTime;
    /**
     * 备注
     */
    @TableField("remark")
    private String remark;
    /**
     * 数据权限
     */
    @TableField("data_scope")
    private String dataScope;

    public void freeData() {
        this.roleId = null;
        this.roleParentId = null;
        this.roleCode = null;
        this.roleName = null;
        this.roleSort = null;
        this.roleStatus = null;
        this.addTime = null;
        this.updateTime = null;
        this.remark = null;
        this.dataScope = null;
    }

}
